export const createDomFromString = (htmlString) => {
    const div = document.createElement('div');
    div.innerHTML = htmlString;
    return div.firstElementChild;
};

// 挂载元素
export const mount = (component, wrapper) => {
    wrapper.appendChild(component._renderDom());
    component.onStateChange = (oldEl, newEl) => {
        wrapper.insertBefore(newEl, oldEl);
        wrapper.removeChild(oldEl);
    }
}